package com.lagou.config;

import org.apache.catalina.startup.Tomcat;

public class SpringApplication {
    public static void run(){
        Tomcat tomcat=new Tomcat();
        tomcat.setPort(8080);

        try{
            //设置资源访问路径
            tomcat.addWebapp("/","F:\\");
            //启动tomcat
            tomcat.start();

            //维持tomcat服务
            tomcat.getServer().await();
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
